//
//  LLCourseDetailsMoreFooterView.m
//  BestLearning
//
//  Created by apple on 2017/2/23.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "LLCourseDetailsMoreFooterView.h"

@implementation LLCourseDetailsMoreFooterView

-(void)layoutSubviews{
    
    self.backgroundColor = [UIColor whiteColor];
    
    UILabel *moreLabel = [[UILabel alloc]init];
    moreLabel.text = @"更多评论";
    moreLabel.font = [UIFont systemFontOfSize:14];
    [self addSubview:moreLabel];
    
    [moreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY).offset(0);
        make.centerX.equalTo(self.mas_centerX).offset(0);
    }];
    
    UIImageView *arrowImageView = [[UIImageView alloc]init];
    arrowImageView.image = [UIImage imageNamed:@"bg_icon_next_default"];
    [self addSubview:arrowImageView];
    
    [arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(moreLabel.mas_right).offset(5);
        make.centerY.equalTo(moreLabel.mas_centerY).offset(0);
        make.size.mas_equalTo(CGSizeMake(15, 15));
    }];

    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(moreClicked)];
    [self addGestureRecognizer:tap];
}

-(void)moreClicked{

    if (self.moreClickedBlock) {
        self.moreClickedBlock();
    }
    
}

@end
